From e4dbaf3593f3af6e3e1d3badf185ec5bd18e8400 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 28 Jul 2005 09:10:05 +0000 Subject: [PATCH] Fix gnttab bug in blkfront. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 07dd06fed6..1f524e3008 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -1428,8 +1428,9 @@ int __init xlblk_init(void) int i; #ifdef CONFIG_XEN_BLKDEV_GRANT - if ( 0 > gnttab_alloc_grant_references( MAXIMUM_OUTSTANDING_BLOCK_REQS, - &gref_head, &gref_terminal )) + /* A grant for every ring slot, plus one for the ring itself. */ + if ( 0 > gnttab_alloc_grant_references(MAXIMUM_OUTSTANDING_BLOCK_REQS + 1, + &gref_head, &gref_terminal) ) return 1; printk(KERN_ALERT "Blkif frontend is using grant tables.\n"); #endif -- 2.30.2